<template>
    <div id="book-info">
        <el-page-header @back="goBack" content="返回列表">
        </el-page-header>
        <div style="margin-bottom: 10px;"></div>
        <el-form ref="form" :model="form" label-width="120px">
            <el-form-item label="书名：">
                <span>{{ form.name }}</span>
            </el-form-item>
            <el-form-item label="作者：">
                <span>{{ form.author }}</span>
            </el-form-item>
            <el-form-item label="所属类别：">
                <span>{{ form.categoryName }}</span>
            </el-form-item>
            <el-form-item label="位置：">
                <span>{{ form.location }}</span>
            </el-form-item>
            <el-form-item label="最迟归还日期：">
                <span>{{ form.deadline }}</span>
            </el-form-item>
            <el-form-item label="处理日期">
                <span>{{ form.handleTime }}</span>
            </el-form-item>
            <el-form-item label="出版社：">
                <span>{{ form.publicationInformation }}</span>
            </el-form-item>
            <el-form-item label="总数：">
                <span>{{ form.totalNumber }}</span>
            </el-form-item>
            <el-form-item label="剩余数：">
                <span>{{ form.spareNumber }}</span>
            </el-form-item>
            <el-form-item label="是否可借阅：">
                <span>{{ form.status ? '不可借阅' : '可借阅' }}</span>
            </el-form-item>

            <el-form-item label="封面：">
                <!-- <img :src="form.picture" alt="" width="100" height="100"> -->
                <el-image style="width: 100px; height: 100px" :src="srcImg"></el-image>
            </el-form-item>

            <el-form-item label="入库时间：">
                <span>{{ form.createTime }}</span>
            </el-form-item>
            <el-form-item label="描述：">
                <span>{{ form.description }}</span>
            </el-form-item>
        </el-form>
    </div>
</template>

<script>
import { expireInfo } from '@/api/expire'

export default {

    methods: {
        getBookInfo() {
            expireInfo({ id: this.id }).then(res => {
                this.form = res.data
                // 
            }).catch(error => {
                reject(error)
            })
        },
        goBack() {
            this.$router.push("/mybook/expire_book")
        },
        continue_library(){
            lendOutInfo({ id: this.id }).then(res => {
                this.$message({
                    type: 'warning',
                    message: res.data
                });
                this.getBookInfo()
            }).catch(error => {
                reject(error)
            })
        }

    },
    created() {
        this.id = this.$route.query.id;
        this.getBookInfo()
    },
    data() {
        return {
            id: '',
            form: {

            },
            srcImg: ''
        }
    }
}
</script>


<style  lang="scss" scoped>
#book-info {
    padding: 40px 20px;
    width: 60%;
}
</style>